Added version and mainClass attributes to <jar> task.#89
Added version and mainClass attributes to <jar> task.#89craigpell wants to merge 3 commits intoapache:masterfrom
Conversation
set binary attributes of a modular jar file. Addresses these tickets: https://bz.apache.org/bugzilla/show_bug.cgi?id=62772 https://bz.apache.org/bugzilla/show_bug.cgi?id=62789
|
Can one of the admins verify this patch? |
3 similar comments
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
manual/Tasks/jar.html
Outdated
| execution entry point. Setting this does not affect the manifest in any way, and specifying | ||
| a Main-Class in the manifest will not cause this attribute to be set. | ||
| <strong>Note:</strong> If this is set to a class which isn't in the jar file, Java will | ||
| refuse to load the module at runtime. |
manual/Tasks/jar.html
Outdated
| </tr> | ||
| <tr> | ||
| <td>build</td> | ||
| <td>Optional build number. Can contain any text. |
| @@ -0,0 +1,59 @@ | |||
| /* | |||
There was a problem hiding this comment.
The commit contains a vim swap file for this class; perhaps .gitignore must be updated?
| @@ -0,0 +1,147 @@ | |||
| /* | |||
There was a problem hiding this comment.
There is another implementation in org.apache.tools.ant.taskdefs.optional.depend.constantpool; perhaps that could be reused?
|
this is ok to test |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
manual/Tasks/jar.html
Outdated
| <td>version</td> | ||
| <td>The <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/module/ModuleDescriptor.Version.html">module version</a> | ||
| to embed into the jar file's module descriptor, if it has one. Not used in Java versions | ||
| older than Java 9. |
There was a problem hiding this comment.
Not used in Java versions older than Java 9.
I think this wording is confusing. Rephrasing it to "Not used in Java versions below Java 9", might be better.
|
Thanks @craigpell, this is a very good enhancement and the code looks very good too. I do have some suggestions/questions about some of the new classes, but I haven't had a chance to fully review this PR. I'll take a more closer look at this one in the next few days and will merge or update this PR with my suggestions/questions. |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
While you are here, a quick suggestion/question - given that these changes are related to Java modules in general and there probably will be more such enhancements for modules, maybe we should rename the newly added |
Added version and mainClass attributes to task, to set binary attributes of a modular jar file. For Ant 1.10.x. Addresses these tickets:
https://bz.apache.org/bugzilla/show_bug.cgi?id=62772
https://bz.apache.org/bugzilla/show_bug.cgi?id=62789